﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace MPev
{
    public class MPGroup
    {
        public MPClassType type = MPClassType.Noun;
        public List<MPClass> list = new List<MPClass>();

        public MPGroup()
        {
        }
        
        public string toString4Dot()
        {
            string ret = "";
            foreach (MPClass c in list)
            {
                ret += c.toString4Dot();
            }
            return ret;
        }

        public void Save(StreamWriter sw)
        {
            sw.WriteLine(list.Count());
            foreach (MPClass c in list)
            {
                c.Save(sw);
            }
        }

        public void Load(StreamReader sr)
        {
            list.Clear();
            int n = Convert.ToInt32(sr.ReadLine());
            while (n > 0)
            {
                MPClass mpclass = new MPClass();
                mpclass.Load(sr);
                list.Add(mpclass);
                n--;
            }
        }
    }
}
